UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bDiRCqtv1Zx8cgWFG+9GWHEkqVXBVzOFVY/RlmQOLwc=' 
WHERE 
  key_id = '358df82d808b95daf3d9903c819a97774dfb97f56ae620a66f4c5744c7d66950' 
  AND (
    token = 'bDiRCqtv1Zx8cgWFG+9GWHEkqVXBVzOFVY/RlmQOLwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068