UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PSyttVNhKN7IvCan0Wpc+J1mn11OMJgpKwo407s815I='
WHERE
key_id = 'a23265df197bc5663756c62c93a7bc57da79d2e73afb2dbbccc429859e27bb58'
AND (
token = 'PSyttVNhKN7IvCan0Wpc+J1mn11OMJgpKwo407s815I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)