UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mNwHffkflwn59sbyz2SdnzsIdxLoiRGw2FD7oHE10Qg='
WHERE
key_id = '88dbf82a8fdf57fb458bf9c2ec1d331d0bf6fe0eac0a274f829f9e96918f81b2'
AND (
token = 'mNwHffkflwn59sbyz2SdnzsIdxLoiRGw2FD7oHE10Qg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)