UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5xt/ZBz8e1ENutFMT20XPopD9Qu2QtSPfUSYBBiuSpw=' 
WHERE 
  key_id = '107870b5c2b5558c6dc0976ec4a4fcabcc423bd320fe57c9861f8a42ea2d65e0' 
  AND (
    token = '5xt/ZBz8e1ENutFMT20XPopD9Qu2QtSPfUSYBBiuSpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047