UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n6ivvQz6/rfjsCwYf7Kji+XGQuDsgwH43JWLlrLJ3sk='
WHERE
key_id = '58a93098c863264198024a195eb1b2504b7f43018b386bf93a2c86fbd72e97f4'
AND (
token = 'n6ivvQz6/rfjsCwYf7Kji+XGQuDsgwH43JWLlrLJ3sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)