UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+S8tbDo57KBkSnQoUJGllUd3+7ThafGo1GiZFp5v1Kc=' 
WHERE 
  key_id = '8eac0cf03af857a07bcedebdcd3ae68bc63e90892ffd8e3b8e8715f54388b5ff' 
  AND (
    token = '+S8tbDo57KBkSnQoUJGllUd3+7ThafGo1GiZFp5v1Kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048