UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Glg9Q+jVbWtGZB2QGii7cayr1ctl9w8QQQHqG23PmKI=' 
WHERE 
  key_id = '28062f397d6fc2a06fec677f02ad3b384ffea30ae4afc499c059556e4c91ffac' 
  AND (
    token = 'Glg9Q+jVbWtGZB2QGii7cayr1ctl9w8QQQHqG23PmKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060