UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FcVbg9paYvgGTwshuCuRstXJcDlhtDCV9IrTV8X3FB4=' 
WHERE 
  key_id = '3119de7a7a09c11420c47e48ca21165b72ef6cdeae133bbb759aa09ba2256e7b' 
  AND (
    token = 'FcVbg9paYvgGTwshuCuRstXJcDlhtDCV9IrTV8X3FB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044