UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '20gTCSt0tEPuTlnwwwVXSjJd3WKRbS+q0hQEVW8IfJk='
WHERE
key_id = '6b20409af3e6aadbe5f5cfe4ae295a528798e04879296bafbdc2f43a145cd4c3'
AND (
token = '20gTCSt0tEPuTlnwwwVXSjJd3WKRbS+q0hQEVW8IfJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)