UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c32IxcHAMLKptHOnz9UMt2ZTvp+r6me8/FjYWeoV1cs=' 
WHERE 
  key_id = '614e1f1f6fad81c6cd4f6de9a8b95f8e5a358ed3ce67deb9742c14363e3aaeb6' 
  AND (
    token = 'c32IxcHAMLKptHOnz9UMt2ZTvp+r6me8/FjYWeoV1cs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019