UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FjcgFvOBwatFk130kwf890EgdfVkF90tojgzgJ7o/WI='
WHERE
key_id = 'eba3592bae1b9585abbeb9b6fa271ac023ff0407511f0a112f00accf901b3a0c'
AND (
token = 'FjcgFvOBwatFk130kwf890EgdfVkF90tojgzgJ7o/WI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)