UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X4R9sv5dEx+ETnTXKWBU7+YnZ4E9/Oxn4QvRjoY9oZQ='
WHERE
key_id = '4d34e034dd83cba7a97464829d3a87b13d23bdcfac62e62717f88ddd83a54c6b'
AND (
token = 'X4R9sv5dEx+ETnTXKWBU7+YnZ4E9/Oxn4QvRjoY9oZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)