UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uCDFfcbzrpKalLPDq0sLkXgROprgvaW0z+RruIqe9Ck=' 
WHERE 
  key_id = '674c7b4dc2085739ad5bc494e23675cce8e20f46f1b17283b2fdb937f61fdfd7' 
  AND (
    token = 'uCDFfcbzrpKalLPDq0sLkXgROprgvaW0z+RruIqe9Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054