UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'avnsHILNdgCk3F0I5HwLnr86F8zvlI7B8ArZ8LrIEU0=' 
WHERE 
  key_id = '1ae6c94e8f5d33f244bb97693d450de8f96e98f64ece2cd8a7a23430e6adb6cc' 
  AND (
    token = 'avnsHILNdgCk3F0I5HwLnr86F8zvlI7B8ArZ8LrIEU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034