UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5UJzra3c2Ug0QPRGHLE0jTrv19UMOfS+Bx8Dp/raBzk=' 
WHERE 
  key_id = 'cfb17003c5b283be8bb860255157e336336f023de38c1d8e2ca27996c82bac2f' 
  AND (
    token = '5UJzra3c2Ug0QPRGHLE0jTrv19UMOfS+Bx8Dp/raBzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026