UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UeZayOwILtZTLSWRzGsLUq7fcPESc6EErm5SEHTZvxM=' 
WHERE 
  key_id = 'bc865eb446c733410641e50a2ec79c08fc5fe6387c04b5f0ea13e8ccae21ef09' 
  AND (
    token = 'UeZayOwILtZTLSWRzGsLUq7fcPESc6EErm5SEHTZvxM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044