UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qCBNiN5ROii6Em75oJHV1Dq4/3ICy2KYokfGyzOVLBY=' 
WHERE 
  key_id = 'd53ac3eaeedbed89bc30b0ac404e83107ea0b71f07c0a17f1d590d748a2bf0b3' 
  AND (
    token = 'qCBNiN5ROii6Em75oJHV1Dq4/3ICy2KYokfGyzOVLBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058