UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7D2nJn9dNhpXnySlbJZFVeQM7n9qwqGzVXSDl0q47E='
WHERE
key_id = '2e9923dcbb2798a798bd5cd21f60a6ed9bc1874bffc7d642115ed458d1c56452'
AND (
token = 'A7D2nJn9dNhpXnySlbJZFVeQM7n9qwqGzVXSDl0q47E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)