UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RCJtizbmk9SuYlKYoTWxb26KM3xEFqY8IOak5E3gMjE='
WHERE
key_id = '23bb830b5c22985cbf59953088c4c563ae4609b6758f222f599bbe5bfa9e2124'
AND (
token = 'RCJtizbmk9SuYlKYoTWxb26KM3xEFqY8IOak5E3gMjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)