UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1G35Ns94jT6EDRti2BilrFZAmB+2J6RLL7w9ZC/Vn2k=' 
WHERE 
  key_id = '8b1501320f676fd61a0a9aac93c3ae55959b7dd21b1385fba0b94a1c05f7d7b4' 
  AND (
    token = '1G35Ns94jT6EDRti2BilrFZAmB+2J6RLL7w9ZC/Vn2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043