UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZqqaPOFvZuDRYMB1vQprymepxyi0/oG1ucgIwnzm1AQ=' 
WHERE 
  key_id = '7e74cd8a7ede903b9e36cd01d089e2dcdacbf013d3fedf7eafef258ff3742c25' 
  AND (
    token = 'ZqqaPOFvZuDRYMB1vQprymepxyi0/oG1ucgIwnzm1AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033