UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/cn3sqDisa0hnQNAe/xYIPHzz6KEo9mjDPrb9sGAngA='
WHERE
key_id = 'fa52f9c36a479570b8148495ff9522e1aadc045e6af754ea86fe6faaf89dafc5'
AND (
token = '/cn3sqDisa0hnQNAe/xYIPHzz6KEo9mjDPrb9sGAngA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)