UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PMeqry6IXHp2yUvYWX0zFUBHwxXqZ/J4v1YeK7HqxYE='
WHERE
key_id = '7302ade2ad652df07e6a9faeb115be51f1093ccea07ec71589a4c7f003a163c6'
AND (
token = 'PMeqry6IXHp2yUvYWX0zFUBHwxXqZ/J4v1YeK7HqxYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)