UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P/bWFetomTNS5qK72CRvIZGCJ22GgW/6deV+HjUFQ00=' 
WHERE 
  key_id = 'f677351bb064cb57ddcb5c7df6fa37e673dd4d54826ba7f6019a19eb6f52dbac' 
  AND (
    token = 'P/bWFetomTNS5qK72CRvIZGCJ22GgW/6deV+HjUFQ00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022