UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eGnGN2tvSMOX3fKh1FHhtxF827Yh386/tCxKD9WZpXk='
WHERE
key_id = 'e14de625addd24f2c73280ca91110ce4b5a8ce758f341cc04cd3cca42db9cf65'
AND (
token = 'eGnGN2tvSMOX3fKh1FHhtxF827Yh386/tCxKD9WZpXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)