UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TYHBRQukBf0vkmHExZlncwqRTraodwTkPKyAfYPgBSE='
WHERE
key_id = '5eb822825066a15da3461c6dbc8fba74ef77a5fcb1c83735f34ebbae44f604c2'
AND (
token = 'TYHBRQukBf0vkmHExZlncwqRTraodwTkPKyAfYPgBSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)