UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0qihgHGzjLGC7thnEd7Vv7tLxPXouQj3xnCdcvtBjVE=' 
WHERE 
  key_id = '914bbfb760516925a11de488530e1e10c0506868e0501d8c2c14729bee58ffb5' 
  AND (
    token = '0qihgHGzjLGC7thnEd7Vv7tLxPXouQj3xnCdcvtBjVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041