UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zIVPtL1jf4GP8/yuRqZgvuNuPR49Yg2aZbERET+hYrM=' 
WHERE 
  key_id = 'c76f370eac7fc1e7f17276581e5d3c5b77ae34c84c777ae0827e7b2ef93856d1' 
  AND (
    token = 'zIVPtL1jf4GP8/yuRqZgvuNuPR49Yg2aZbERET+hYrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043