UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '37brkBNnL3Jy044jegio3XLk65l11kMKVXTK7at2WhU=' 
WHERE 
  key_id = '16ee55790fbb247451d9fe1d0655038f24a181f7dc31e110dffa0ac5126a311d' 
  AND (
    token = '37brkBNnL3Jy044jegio3XLk65l11kMKVXTK7at2WhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055