UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RrepnctMfp5no182ol/jWxVIVDk7cSHqV1V1V6/HOEE='
WHERE
key_id = 'b601786281b7398557aab2d90c0425d26418cb4e4e4ecd78476c21214f710a3b'
AND (
token = 'RrepnctMfp5no182ol/jWxVIVDk7cSHqV1V1V6/HOEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)