UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pEeSaMSxafDuqmJPQ9mDk/s4VE2UA4M9PQuReQa/eDw='
WHERE
key_id = '177a4a6d1515c5d07e69266e3aa32ff4c71f17621dbc65c2441591b02752d6aa'
AND (
token = 'pEeSaMSxafDuqmJPQ9mDk/s4VE2UA4M9PQuReQa/eDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)