UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M4A1jwNbrrqmrGL7MAR82Fjlgvho8y9GALQMaxZLoIU='
WHERE
key_id = '0917319c7786209efb140910a9d96a918987f828ce7115477a54a253a65697af'
AND (
token = 'M4A1jwNbrrqmrGL7MAR82Fjlgvho8y9GALQMaxZLoIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)