UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f5cawz6APqE+KjyXz5H2eqaWFj3IChzscUKaD5CZKAM='
WHERE
key_id = '711bea0616d14cebf328d47d5e679e719ba8a152915a56dfbeb3db8c288b7ede'
AND (
token = 'f5cawz6APqE+KjyXz5H2eqaWFj3IChzscUKaD5CZKAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)