UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dPO1w6hmf4DhSFVasQLrIwrEHb7aOhqzeOy9YlmO9c8='
WHERE
key_id = 'a71564c68abfb0dfbfc52a9d1318ddba7d2500b68055af1fbd7e6f58cda0ea3f'
AND (
token = 'dPO1w6hmf4DhSFVasQLrIwrEHb7aOhqzeOy9YlmO9c8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)